#include <iostream>
using namespace std;
int buscar (string cadena, char c);
int main ()
{
    string cadena;
    char c;
    cin>>cadena;
    cin>>c;
    cout<<buscar (cadena,c);
    return 1;
}
int buscar (string cadena, char c)
{
    int i;
    i=0;
    while (i<cadena.length())
    {
        if(cadena[i]==c)
        {
            return i+1;
        }
        i++;
    }
    return 1;
}
